package com.tele.service.imps;

import com.tele.domain.SolutionMenu;
import com.tele.mapper.SolutionMenuMapper;
import com.tele.service.ints.SolutionMenuService;
import org.springframework.stereotype.Service;

import java.util.List;
import javax.annotation.Resource;

/**
 * (SolutionMenu)表服务实现类
 *
 * @author makejava
 * @since 2023-08-23 15:56:25
 */
@Service("solutionMenuService")
public class SolutionMenuServiceImpl implements SolutionMenuService{
    @Resource
    private SolutionMenuMapper solutionMenuMapper;

    /**
     * 查询所有数据
     *
     * @return 实例对象集合
     */
    @Override
    public List<SolutionMenu> queryAll() {
        return this.solutionMenuMapper.queryAll();
    }

    /**
     * 通过ID查询单条数据
     *
     * @param menuId 主键
     * @return 实例对象
     */
    @Override
    public SolutionMenu queryById(Integer menuId) {
        return this.solutionMenuMapper.queryById(menuId);
    }

    /**
     * 新增数据
     *
     * @param solutionMenu 实例对象
     * @return 实例对象
     */
    @Override
    public SolutionMenu insert(SolutionMenu solutionMenu) {
        this.solutionMenuMapper.insert(solutionMenu);
        return solutionMenu;
    }

    /**
     * 修改数据
     *
     * @param solutionMenu 实例对象
     * @return 实例对象
     */
    @Override
    public SolutionMenu update(SolutionMenu solutionMenu) {
        this.solutionMenuMapper.update(solutionMenu);
        return this.queryById(solutionMenu.getMenuId());
    }

    /**
     * 通过主键删除数据
     *
     * @param menuId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer menuId) {
        return this.solutionMenuMapper.deleteById(menuId) > 0;
    }
}

